<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.org/ui" template="/layout/template.xhtml">
	<ui:define name="body">
		<h1 class="title ui-widget-header ui-corner-all">Mantenimiento Punto Almacen</h1>
		<h:form id="frmAlmacenForm">
			 
			<p:panel  header="#{message['panel.mantenimiento.punto']}">
			<h:panelGrid id="display" columns="3" cellpadding="5" >
				<h:outputText value="#{message['almacen.descripcion']}" />
				
				<p:inputText id="desc" value="#{almacenForm.objAlmacenSie.descripcion}" required="true"
				requiredMessage="#{message['puntoVenta.descripcion.validation']}" style="width:220px;font-weight:bold" />
				<p:message for="desc" />
				
				<h:outputText value="#{message['contrato.ubigeo.departamento']}" />
				<p:selectOneMenu id="dep" value="#{almacenForm.idDepartamento}" filter="true" filterMatchMode="startsWith"
					required="true" style="width:220px"
					requiredMessage="#{message['puntoVenta.ubigeo.departamento.validation']}" >
					<f:selectItem itemLabel="Seleccione Departamento" itemValue="#{null}" />
					<f:selectItems value="#{comboAction.ubigeoDeparItems}" />
					<p:ajax update="prov,dist" listener="#{almacenForm.cambiar}" />
				</p:selectOneMenu>
				<p:message for="dep"  />

				<h:outputText value="#{message['contrato.ubigeo.provincia']}" />
				<p:selectOneMenu id="prov" value="#{almacenForm.idProvincia}" filter="true" filterMatchMode="startsWith"
					required="true" style="width:220px"
					requiredMessage="#{message['puntoVenta.ubigeo.provincia.validation']}" >
					<f:selectItem itemLabel="Seleccione Provincia" itemValue="#{null}" />
					<f:selectItems value="#{comboAction.ubigeoProvinItems}" />
					<p:ajax update="dist" listener="#{almacenForm.cambiar2}" />
				</p:selectOneMenu>
				<p:message for="prov" />

				<h:outputText value="#{message['contrato.ubigeo.distrito']}" />
				<p:selectOneMenu id="dist" value="#{almacenForm.idUbigeo}" filter="true" filterMatchMode="startsWith"
					required="true" style="width:220px"
					requiredMessage="#{message['puntoVenta.ubigeo.distrito.validation']}" >
					<f:selectItem itemLabel="Seleccione Distrito" itemValue="#{null}" />
					<f:selectItems value="#{comboAction.ubigeoDistriItems}" />
					<p:ajax update="ubigeoDefecto" listener="#{almacenForm.busquedaUbigeo}" />
				</p:selectOneMenu>
				<p:message for="dist" />
				
				<h:outputText value="Ubigeo " />
				<h:outputText id="ubigeoDefecto" value="#{almacenForm.ubigeoDefecto}" />
				<p:spacer/>
				
				<h:outputText value="#{message['almacen.direccion']}" />
				<p:inputText id="iconOnly" value="#{almacenForm.objAlmacenSie.direccion}" required="true" 
					requiredMessage="#{message['puntoVenta.direccion.validation']}" />
				<p:message for="iconOnly" /> 
				 
				<h:outputText value="#{message['almacen.tipo']}" />
				<p:selectOneMenu id="tipo" value="#{almacenForm.objTipoPv.idtipopuntoventa}">
					<f:selectItems value="#{comboAction.tipoalmacenitems}" />
				</p:selectOneMenu>
				<p:message for="tipo" />
				
				<p:commandButton value="Guardar" action="#{almacenForm.insertar}" ajax="false" icon="ui-icon ui-icon-disk"  />
						
				<p:commandButton value="Regresar" action="#{almacenSearch.listar}" immediate="true" ajax = "false" 
				  icon="ui-icon-circle-arrow-w" />

			</h:panelGrid>
			</p:panel>
		 </h:form>
	</ui:define>
</ui:composition>